require("../../both/base.js")
require("./UserVideoAttachment.scss")

class UserVideoAttachment extends React.Component{
    render(){
        var lists
        if(this.props.isFile){     // 如果是文件

            lists = this.props.listData.map((e,i) => {
                return <li key={i}>
                    <div className="file_wr">
                        <div className="file_name">
                            <i className="fa fa-folder"></i>
                            &nbsp;
                            {e.title}
                        </div>
                        <a href={e.location} className="file_a" target="_blank"><div className="file_download">
                            下载
                        </div></a>
                    </div>
                </li>
            })

        }else{

            lists = this.props.listData.map((e,i) => {
                return <li key={i}>
                    <a href={e.href}>
                        {e.title}
                    </a>
                </li>
            })

        }

        return <div className="user_video_attachment_cr bln">
            <div className="title">{this.props.title}</div>
            <ul className="user_video_attachment">
                {lists}
            </ul>
        </div>
    }
}

export default UserVideoAttachment